3.1.81 \(\int \frac {(d+e x) (a+b \log (c x^n))^2}{x^3} \, dx\) [81]

Optimal. Leaf size=103 \[ -\frac {b^2 d n^2}{4 x^2}-\frac {2 b^2 e n^2}{x}-\frac {b d n \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac {2 b e n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x} \]

[Out]

-1/4*b^2*d*n^2/x^2-2*b^2*e*n^2/x-1/2*b*d*n*(a+b*ln(c*x^n))/x^2-2*b*e*n*(a+b*ln(c*x^n))/x-1/2*d*(a+b*ln(c*x^n))
^2/x^2-e*(a+b*ln(c*x^n))^2/x

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2395, 2342, 2341} \begin {gather*} -\frac {b d n \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac {2 b e n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac {b^2 d n^2}{4 x^2}-\frac {2 b^2 e n^2}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(a + b*Log[c*x^n])^2)/x^3,x]

[Out]

-1/4*(b^2*d*n^2)/x^2 - (2*b^2*e*n^2)/x - (b*d*n*(a + b*Log[c*x^n]))/(2*x^2) - (2*b*e*n*(a + b*Log[c*x^n]))/x -
 (d*(a + b*Log[c*x^n])^2)/(2*x^2) - (e*(a + b*Log[c*x^n])^2)/x

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rubi steps

\begin {align*} \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^3} \, dx &=\int \left (\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x^3}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x^2}\right ) \, dx\\ &=d \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^3} \, dx+e \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx\\ &=-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x}+(b d n) \int \frac {a+b \log \left (c x^n\right )}{x^3} \, dx+(2 b e n) \int \frac {a+b \log \left (c x^n\right )}{x^2} \, dx\\ &=-\frac {b^2 d n^2}{4 x^2}-\frac {2 b^2 e n^2}{x}-\frac {b d n \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac {2 b e n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 90, normalized size = 0.87 \begin {gather*} -\frac {2 a^2 (d+2 e x)+2 a b n (d+4 e x)+b^2 n^2 (d+8 e x)+2 b (2 a (d+2 e x)+b n (d+4 e x)) \log \left (c x^n\right )+2 b^2 (d+2 e x) \log ^2\left (c x^n\right )}{4 x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n])^2)/x^3,x]

[Out]

-1/4*(2*a^2*(d + 2*e*x) + 2*a*b*n*(d + 4*e*x) + b^2*n^2*(d + 8*e*x) + 2*b*(2*a*(d + 2*e*x) + b*n*(d + 4*e*x))*
Log[c*x^n] + 2*b^2*(d + 2*e*x)*Log[c*x^n]^2)/x^2

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.11, size = 1483, normalized size = 14.40

method result size
risch \(\text {Expression too large to display}\) \(1483\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2/x^3,x,method=_RETURNVERBOSE)

[Out]

-1/2*b^2*(2*e*x+d)/x^2*ln(x^n)^2-1/2*(-2*I*Pi*b^2*e*x*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+2*I*Pi*b^2*e*x*csgn(
I*c)*csgn(I*c*x^n)^2+2*I*Pi*b^2*e*x*csgn(I*x^n)*csgn(I*c*x^n)^2-2*I*Pi*b^2*e*x*csgn(I*c*x^n)^3+4*ln(c)*b^2*e*x
+4*b^2*n*e*x+4*a*b*e*x-I*Pi*b^2*d*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+I*Pi*b^2*d*csgn(I*c)*csgn(I*c*x^n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*c*x^n)^3-4*Pi^2
*b^2*d*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4)/x^2

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 155, normalized size = 1.50 \begin {gather*} -\frac {1}{4} \, b^{2} d {\left (\frac {n^{2}}{x^{2}} + \frac {2 \, n \log \left (c x^{n}\right )}{x^{2}}\right )} - 2 \, b^{2} {\left (\frac {n^{2}}{x} + \frac {n \log \left (c x^{n}\right )}{x}\right )} e - \frac {b^{2} e \log \left (c x^{n}\right )^{2}}{x} - \frac {2 \, a b n e}{x} - \frac {2 \, a b e \log \left (c x^{n}\right )}{x} - \frac {b^{2} d \log \left (c x^{n}\right )^{2}}{2 \, x^{2}} - \frac {a b d n}{2 \, x^{2}} - \frac {a^{2} e}{x} - \frac {a b d \log \left (c x^{n}\right )}{x^{2}} - \frac {a^{2} d}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^3,x, algorithm="maxima")

[Out]

-1/4*b^2*d*(n^2/x^2 + 2*n*log(c*x^n)/x^2) - 2*b^2*(n^2/x + n*log(c*x^n)/x)*e - b^2*e*log(c*x^n)^2/x - 2*a*b*n*
e/x - 2*a*b*e*log(c*x^n)/x - 1/2*b^2*d*log(c*x^n)^2/x^2 - 1/2*a*b*d*n/x^2 - a^2*e/x - a*b*d*log(c*x^n)/x^2 - 1
/2*a^2*d/x^2

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 180, normalized size = 1.75 \begin {gather*} -\frac {b^{2} d n^{2} + 2 \, a b d n + 2 \, a^{2} d + 4 \, {\left (2 \, b^{2} n^{2} + 2 \, a b n + a^{2}\right )} x e + 2 \, {\left (2 \, b^{2} x e + b^{2} d\right )} \log \left (c\right )^{2} + 2 \, {\left (2 \, b^{2} n^{2} x e + b^{2} d n^{2}\right )} \log \left (x\right )^{2} + 2 \, {\left (b^{2} d n + 2 \, a b d + 4 \, {\left (b^{2} n + a b\right )} x e\right )} \log \left (c\right ) + 2 \, {\left (b^{2} d n^{2} + 2 \, a b d n + 4 \, {\left (b^{2} n^{2} + a b n\right )} x e + 2 \, {\left (2 \, b^{2} n x e + b^{2} d n\right )} \log \left (c\right )\right )} \log \left (x\right )}{4 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^3,x, algorithm="fricas")

[Out]

-1/4*(b^2*d*n^2 + 2*a*b*d*n + 2*a^2*d + 4*(2*b^2*n^2 + 2*a*b*n + a^2)*x*e + 2*(2*b^2*x*e + b^2*d)*log(c)^2 + 2
*(2*b^2*n^2*x*e + b^2*d*n^2)*log(x)^2 + 2*(b^2*d*n + 2*a*b*d + 4*(b^2*n + a*b)*x*e)*log(c) + 2*(b^2*d*n^2 + 2*
a*b*d*n + 4*(b^2*n^2 + a*b*n)*x*e + 2*(2*b^2*n*x*e + b^2*d*n)*log(c))*log(x))/x^2

________________________________________________________________________________________

Sympy [A]
time = 0.29, size = 165, normalized size = 1.60 \begin {gather*} - \frac {a^{2} d}{2 x^{2}} - \frac {a^{2} e}{x} - \frac {a b d n}{2 x^{2}} - \frac {a b d \log {\left (c x^{n} \right )}}{x^{2}} - \frac {2 a b e n}{x} - \frac {2 a b e \log {\left (c x^{n} \right )}}{x} - \frac {b^{2} d n^{2}}{4 x^{2}} - \frac {b^{2} d n \log {\left (c x^{n} \right )}}{2 x^{2}} - \frac {b^{2} d \log {\left (c x^{n} \right )}^{2}}{2 x^{2}} - \frac {2 b^{2} e n^{2}}{x} - \frac {2 b^{2} e n \log {\left (c x^{n} \right )}}{x} - \frac {b^{2} e \log {\left (c x^{n} \right )}^{2}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2/x**3,x)

[Out]

-a**2*d/(2*x**2) - a**2*e/x - a*b*d*n/(2*x**2) - a*b*d*log(c*x**n)/x**2 - 2*a*b*e*n/x - 2*a*b*e*log(c*x**n)/x
- b**2*d*n**2/(4*x**2) - b**2*d*n*log(c*x**n)/(2*x**2) - b**2*d*log(c*x**n)**2/(2*x**2) - 2*b**2*e*n**2/x - 2*
b**2*e*n*log(c*x**n)/x - b**2*e*log(c*x**n)**2/x

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 205 vs. \(2 (100) = 200\).
time = 2.49, size = 205, normalized size = 1.99 \begin {gather*} -\frac {4 \, b^{2} n^{2} x e \log \left (x\right )^{2} + 8 \, b^{2} n^{2} x e \log \left (x\right ) + 8 \, b^{2} n x e \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d n^{2} \log \left (x\right )^{2} + 8 \, b^{2} n^{2} x e + 8 \, b^{2} n x e \log \left (c\right ) + 4 \, b^{2} x e \log \left (c\right )^{2} + 2 \, b^{2} d n^{2} \log \left (x\right ) + 8 \, a b n x e \log \left (x\right ) + 4 \, b^{2} d n \log \left (c\right ) \log \left (x\right ) + b^{2} d n^{2} + 8 \, a b n x e + 2 \, b^{2} d n \log \left (c\right ) + 8 \, a b x e \log \left (c\right ) + 2 \, b^{2} d \log \left (c\right )^{2} + 4 \, a b d n \log \left (x\right ) + 2 \, a b d n + 4 \, a^{2} x e + 4 \, a b d \log \left (c\right ) + 2 \, a^{2} d}{4 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^3,x, algorithm="giac")

[Out]

-1/4*(4*b^2*n^2*x*e*log(x)^2 + 8*b^2*n^2*x*e*log(x) + 8*b^2*n*x*e*log(c)*log(x) + 2*b^2*d*n^2*log(x)^2 + 8*b^2
*n^2*x*e + 8*b^2*n*x*e*log(c) + 4*b^2*x*e*log(c)^2 + 2*b^2*d*n^2*log(x) + 8*a*b*n*x*e*log(x) + 4*b^2*d*n*log(c
)*log(x) + b^2*d*n^2 + 8*a*b*n*x*e + 2*b^2*d*n*log(c) + 8*a*b*x*e*log(c) + 2*b^2*d*log(c)^2 + 4*a*b*d*n*log(x)
 + 2*a*b*d*n + 4*a^2*x*e + 4*a*b*d*log(c) + 2*a^2*d)/x^2

________________________________________________________________________________________

Mupad [B]
time = 3.54, size = 109, normalized size = 1.06 \begin {gather*} -\frac {x\,\left (2\,e\,a^2+4\,e\,a\,b\,n+4\,e\,b^2\,n^2\right )+a^2\,d+\frac {b^2\,d\,n^2}{2}+a\,b\,d\,n}{2\,x^2}-\frac {\ln \left (c\,x^n\right )\,\left (\frac {b\,d\,\left (2\,a+b\,n\right )}{2}+2\,b\,e\,x\,\left (a+b\,n\right )\right )}{x^2}-\frac {{\ln \left (c\,x^n\right )}^2\,\left (\frac {b^2\,d}{2}+b^2\,e\,x\right )}{x^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*log(c*x^n))^2*(d + e*x))/x^3,x)

[Out]

- (x*(2*a^2*e + 4*b^2*e*n^2 + 4*a*b*e*n) + a^2*d + (b^2*d*n^2)/2 + a*b*d*n)/(2*x^2) - (log(c*x^n)*((b*d*(2*a +
 b*n))/2 + 2*b*e*x*(a + b*n)))/x^2 - (log(c*x^n)^2*((b^2*d)/2 + b^2*e*x))/x^2

________________________________________________________________________________________